package com.zsc.oj.zojcodesendbox.judge;

import cn.hutool.core.io.FileUtil;
import cn.hutool.core.io.resource.ResourceUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.dfa.FoundWord;
import cn.hutool.dfa.WordTree;
import com.zsc.oj.zojcodesendbox.security.DefaultSecurityManager;
import com.zsc.oj.zojcodesendbox.utils.ProcessUtils;
import com.zsc.oj.zojcodesendbox.utils.model.ExecuteMessage;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.io.File;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.UUID;

/**
 * java原生代码沙箱
 */

@Component
public class JavaNativeCodeSendBox extends JavaCodeSendBoxTemplate{

    @Override
    public ExecuteCodeResponse ExecuteCode(ExecuteCodeRequest executeCodeRequest) {
        return super.ExecuteCode(executeCodeRequest);
    }

    //测试
//    public static void main(String[] args) {
//        JavaNativeCodeSendBox javaNativeCodeSendBox = new JavaNativeCodeSendBox();
//        ExecuteCodeRequest executeCodeRequest = new ExecuteCodeRequest();
//        //读取代码
//        String code = ResourceUtil.readStr("test/Main.java", StandardCharsets.UTF_8);
//        executeCodeRequest.setCode(code);
//        executeCodeRequest.setLanguage("java");
//        executeCodeRequest.setInputList(Arrays.asList("1 2","1 3"));
//        ExecuteCodeResponse executeCodeResponse = javaNativeCodeSendBox.ExecuteCode(executeCodeRequest);
//        System.out.println(executeCodeResponse);
//    }

}
